package com.ruoyi.receipt.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.receipt.utils.UserInitUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.receipt.mapper.TbSubjectClusteMapper;
import com.ruoyi.receipt.domain.TbSubjectCluste;
import com.ruoyi.receipt.service.ITbSubjectClusteService;

/**
 * 题簇管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-29
 */
@Service
public class TbSubjectClusteServiceImpl implements ITbSubjectClusteService {
    @Autowired
    private TbSubjectClusteMapper tbSubjectClusteMapper;

    /**
     * 查询题簇管理
     *
     * @param id 题簇管理ID
     * @return 题簇管理
     */
    @Override
    public TbSubjectCluste selectTbSubjectClusteById(Long id) {
        return tbSubjectClusteMapper.selectTbSubjectClusteById(id);
    }

    /**
     * 查询题簇管理列表
     *
     * @param tbSubjectCluste 题簇管理
     * @return 题簇管理
     */
    @Override
    //@DataScope(deptAlias = "da",userAlias = "createId")
    public List<TbSubjectCluste> selectTbSubjectClusteList(TbSubjectCluste tbSubjectCluste) {
        return tbSubjectClusteMapper.selectTbSubjectClusteList(tbSubjectCluste);
    }

    /**
     * 新增题簇管理
     *
     * @param tbSubjectCluste 题簇管理
     * @return 结果
     */
    @Override
    public int insertTbSubjectCluste(TbSubjectCluste tbSubjectCluste) {
        tbSubjectCluste.setCreateTime(DateUtils.getNowDate());
        UserInitUtils.initUserInfo(tbSubjectCluste);
        return tbSubjectClusteMapper.insertTbSubjectCluste(tbSubjectCluste);
    }

    /**
     * 修改题簇管理
     *
     * @param tbSubjectCluste 题簇管理
     * @return 结果
     */
    @Override
    public int updateTbSubjectCluste(TbSubjectCluste tbSubjectCluste) {
        tbSubjectCluste.setUpdateTime(DateUtils.getNowDate());
        UserInitUtils.initUserInfoForUpdate(tbSubjectCluste);
        return tbSubjectClusteMapper.updateTbSubjectCluste(tbSubjectCluste);
    }

    /**
     * 批量删除题簇管理
     *
     * @param ids 需要删除的题簇管理ID
     * @return 结果
     */
    @Override
    public int deleteTbSubjectClusteByIds(Long[] ids) {
        return tbSubjectClusteMapper.deleteTbSubjectClusteByIds(ids);
    }

    /**
     * 删除题簇管理信息
     *
     * @param id 题簇管理ID
     * @return 结果
     */
    @Override
    public int deleteTbSubjectClusteById(Long id) {
        return tbSubjectClusteMapper.deleteTbSubjectClusteById(id);
    }

    @Override
    public List<TbSubjectCluste> selectName(String clusteName) {
        return tbSubjectClusteMapper.selectName(clusteName);
    }

    @Override
    public List<TbSubjectCluste> selectClusteStatus(TbSubjectCluste tbSubjectCluste) {
        return tbSubjectClusteMapper.selectClusteStatus(tbSubjectCluste);
    }
}
